package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.DevicePackageMapper;
import com.ruoyi.manage.domain.DevicePackage;
import com.ruoyi.manage.service.IDevicePackageService;

/**
 * 器械包Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-06-04
 */
@Service
public class DevicePackageServiceImpl implements IDevicePackageService 
{
    @Autowired
    private DevicePackageMapper devicePackageMapper;

    /**
     * 查询器械包
     * 
     * @param devicePackageId 器械包主键
     * @return 器械包
     */
    @Override
    public DevicePackage selectDevicePackageByDevicePackageId(Long devicePackageId)
    {
        return devicePackageMapper.selectDevicePackageByDevicePackageId(devicePackageId);
    }

    /**
     * 查询器械包列表
     * 
     * @param devicePackage 器械包
     * @return 器械包
     */
    @Override
    public List<DevicePackage> selectDevicePackageList(DevicePackage devicePackage)
    {
        return devicePackageMapper.selectDevicePackageList(devicePackage);
    }

    /**
     * 新增器械包
     * 
     * @param devicePackage 器械包
     * @return 结果
     */
    @Override
    public int insertDevicePackage(DevicePackage devicePackage)
    {
        devicePackage.setCreateTime(DateUtils.getNowDate());
        return devicePackageMapper.insertDevicePackage(devicePackage);
    }

    /**
     * 修改器械包
     * 
     * @param devicePackage 器械包
     * @return 结果
     */
    @Override
    public int updateDevicePackage(DevicePackage devicePackage)
    {
        devicePackage.setUpdateTime(DateUtils.getNowDate());
        return devicePackageMapper.updateDevicePackage(devicePackage);
    }

    /**
     * 批量删除器械包
     * 
     * @param devicePackageIds 需要删除的器械包主键
     * @return 结果
     */
    @Override
    public int deleteDevicePackageByDevicePackageIds(Long[] devicePackageIds)
    {
        return devicePackageMapper.deleteDevicePackageByDevicePackageIds(devicePackageIds);
    }

    /**
     * 删除器械包信息
     * 
     * @param devicePackageId 器械包主键
     * @return 结果
     */
    @Override
    public int deleteDevicePackageByDevicePackageId(Long devicePackageId)
    {
        return devicePackageMapper.deleteDevicePackageByDevicePackageId(devicePackageId);
    }
}
